package com.cn.wanxi.servlet;

import com.cn.wanxi.model.CompanyModel;
import com.cn.wanxi.model.NavModel;
import com.cn.wanxi.service.CompanyService;
import com.cn.wanxi.service.NavService;

import javax.servlet.http.HttpServletRequest;

class CommonServlet {
    static void setCompanyAndNavData(HttpServletRequest req) {
        CompanyService companyService = new CompanyService();
        CompanyModel companyModel = companyService.getCompanyModel();
        req.setAttribute("companyModel", companyModel);
        NavService navService = new NavService();
        NavModel[] navModels = navService.getNavModels();

        req.setAttribute("navModels", navModels);//key-value的形式
    }
}
